package start;

import java.text.SimpleDateFormat;

import java.util.Date;

import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class HelloWorldController {
    
    @RequestMapping("/hello")
    public String helloWorld(Model model, @PathVariable
        String day) {
        System.out.println("!!! HelloWorldController.helloWorld(" + model + ")");
        model.addAttribute("message", "Hello World! " + day);
        System.out.println("!!! HelloWorldController.helloWorld(" + model + ")");
        return "/resources/helloWorld.html";
    }

    @RequestMapping("/days/{day}")
    public String test(Model model, @PathVariable("day")
        String day) {
        model.addAttribute("message", "Hello World! " + day);
        return "/resources/helloWorld.html";
    }
}
